package com.foreknow.springboot.controller;

import com.foreknow.springboot.po.Food;
import com.foreknow.springboot.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xiaoming
 * @version jdk1.8
 * @date 2022/8/13 21:46
 * @function:
 */
@RestController
@RequestMapping("/FoodController")
public class FoodController {
    //注入依赖
    @Autowired
    private FoodService foodService;

    //http://localhost:8089/elm/FoodController/listFoodByBusinessId?businessId=10001
    @RequestMapping("/listFoodByBusinessId")
    public List<Food> listFoodByBusinessId(Food food){
        return foodService.listFoodByBusinessId(food.getBusinessId());
    }
}
